package com.zhangwei.expands.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;

/**
 * @version V1.0
 * @description:
 * @title: Expands
 * @package com.zhangwei.expands.adapter
 * @author: zhangwei
 * @date: 2015-12-15 下午11:30
 */
public class MainPagerAdapter extends FragmentStatePagerAdapter {
    private ArrayList<Fragment> fragments;


    public MainPagerAdapter(FragmentManager fm, ArrayList<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
